package com.gxa.service.impl;

import com.github.pagehelper.PageHelper;
import com.gxa.mapper.HospitalMapper;
import com.gxa.pojo.Hospital;
import com.gxa.service.HospitalService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("hospitalService")
public class HospitalServiceImpl implements HospitalService {

    @Resource
    HospitalMapper hospitalMapper=null;



    @Override
    public void deleteBatch(List<Integer> list) {

    }

    @Override
    public Boolean register(Hospital hospital) {
        int i = hospitalMapper.insert(hospital);
        return true;
    }

    @Override
    public Hospital findById(Integer id) {
        Hospital hospital = hospitalMapper.findById(1);
        System.out.println(hospital);
        return hospital;
    }

    @Override
    public List<Hospital> findByPage(int currentpage, int limit) {
        PageHelper.startPage(currentpage, limit);
        List<Hospital> all = hospitalMapper.findByAll();
        return all;
    }

    @Override
    public Boolean updateById(Hospital hospital) {
        int i = hospitalMapper.updateById(hospital);
        return true;
    }
}
